<form method="post">
test: <input type="text" name="text" value="<?=rand(1,9999)?>" />
<input type="submit" value="Test population" />
</form>
<small>Submit the button and the field is automaticly populated to the next page, refresh (without $_POST), to see random number.</small>